package com.zzl.finance.data.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * @author gull
 * @date 2021-11-09 20:04:58
 */
@Data
@ApidocModel
@SuppressWarnings("javadoc")
public class EnterpriseAddDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 姓名、证件号码、企业全称、社会信用代码50个字注册地址100个字
     * 3.密码：请输入6~18位的字母和数字组合
     * 4.用户名：最多32位
     */
    @Email(message = "邮箱格式不正确")
    @NotBlank(message = "经办人邮箱号不能为空")
    @ApidocModelProperty(description = "邮箱")
    private String supplierEmail;
    @NotBlank(message = "经办人手机号不能为空")
    @Pattern(regexp = "(^1[0-9]{10}$)", message = "经办人手机号输入不正确！")
    @ApidocModelProperty(description = "经办人手机号")
    private String supplierPhone;
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,18}$", message = "请输入6~18位的字母和数字组合")
    @ApidocModelProperty(description = "密码")
    private String supplierPassword;
    @NotBlank(message = "用户名为空")
    @Length(max = 32)
    @ApidocModelProperty(description = "登录人用户名")
    private String userName;
    @NotBlank(message = "经办人手机号验证码不能为空")
    @ApidocModelProperty(description = "经办人手机号验证码")
    private String supplierPhoneCode;
    @Length(max = 50)
    @NotBlank(message = "企业全称不能为空")
    @ApidocModelProperty(description = "企业名称")
    private String enterpriseName;
    @Length(max = 50)
    @NotBlank(message = "统一社会信用代码不能为空")
    @ApidocModelProperty(description = "统一社会信用代码")
    private String socialCreditCode;


    @ApidocModelProperty(description = "企业类型")
    private String enterpriseType;
    @Length(max = 50)
    @NotBlank(message = "注册地址不能为空")
    @ApidocModelProperty(description = "企业地址")
    private String businessAddress;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "成立日期", validate = "yyyy-MM-dd")
    private Date incorporationTime;
    @NotEmpty(message = "注册资本不能为空")
    @ApidocModelProperty(description = "注册资本，如100万元")
    private String registeredCapital;
    @NotEmpty(message = "企业经营范围不能为空")
    @ApidocModelProperty(description = "企业经营范围")
    private String businessScope;


    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "营业执照有效期", validate = "yyyy-MM-dd")
    private Date businessLicenseExpireTime;
    @NotBlank(message = "营业执照不能为空")
    @ApidocModelProperty(description = "营业执照")
    private String businessLicense;
    @ApidocModelProperty(description = "是否长期有效，1 长期有效，0有效期内有效")
    private Boolean businessLicenseLongTime;
    //原型变更，不确定后面是否需要
    //    @ApidocModelProperty(description = "开户行")
    //    private String depositBank;
    //    @ApidocModelProperty(description = "打款账号")
    //    private String paymentAccount;
    //    @ApidocModelProperty(description = "企业地址-市区")
    //    private String businessAddressArea;
//    @ApidocModelProperty(description = "短信验证码")
//    private String phoneCode;

    @NotBlank(message = "证件类型不能为空")
    @ApidocModelProperty(description = "法人证件类型，ID_CARD身份证")
    private String legalCertificateType;
    @NotBlank(message = "身份证正面不能为空")
    @ApidocModelProperty(description = "身份证正面")
    private String frontIdentityCard;
    @NotBlank(message = "身份证反面不能为空")
    @ApidocModelProperty(description = "身份证反面")
    private String backIdentityCard;
    @Length(max = 50)
    @NotBlank(message = "姓名不能为空")
    @ApidocModelProperty(description = "法人姓名")
    private String legalUserName;
    @Length(max = 50)
    @NotBlank(message = "证件号码不能为空")
    @ApidocModelProperty(description = "法人证件号码")
    private String legalIdentification;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "证件有效期", validate = "yyyy-MM-dd")
    private Date legalCertificateExpireTime;
    @ApidocModelProperty(description = "是否长期有效，1 长期有效，0有效期内有效")
    private Boolean legalIdentificationLongTime;
    @Pattern(regexp = "(^1[0-9]{10}$)", message = "法人手机号输入不正确！")
    @NotBlank(message = "法人手机号不能为空")
    @ApidocModelProperty(description = "法人手机号")
    private String legalPhone;
    @NotBlank(message = "法人手机号验证码不能为空")
    @ApidocModelProperty(description = "法人手机号验证码")
    private String legalPhoneCode;
    @ApidocModelProperty(description = "父级供应商id")
    private String supplierParentId;
    @NotBlank(message = "授权函不能为空")
    @ApidocModelProperty(description = "授权函")
    private String authorizationLetter;

}
